<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>ViewIssue</title>

<%@include file="editheader.jsp"%>


<script type="text/javascript" charset="utf-8">
var editissueid=0;

function EditPageInit(issueid, role) {

	editissueid = issueid;
	//alert("detail: "+ $("#hissuedetail").val());
	CKEDITOR.instances.issuedetails.setData($("#hissuedetail").val());
	
}


</script>


</head>
<body
	onload="EditPageInit(<%=request.getParameter("issueid")%>, <%=session.getAttribute("userrole")%>)">

	<%@include file="toppanel.jsp"%>

	<%@ page import="java.util.Map"%>
	<%
		wiki.GetDetails MyIssue = new wiki.GetDetails();
		String issueid = request.getParameter("issueid");
		Map<String, String>  MyIssueDetail =  MyIssue.GetIssueDetail(issueid);  

		//String module = MyIssueDetail.get("Module");
		//System.out.println("Module: " + module);
	%>

	<input type="hidden" id="hissuedetail"
		value="<%=MyIssueDetail.get("Details")%>" />

	<input type="hidden" id="hmodule"
		value="<%=MyIssueDetail.get("Moduleid")%>" />


	<input type="hidden" id="hcategory"
		value="<%=MyIssueDetail.get("Categoryid")%>" />
	<input type="hidden" id="hsubcategory"
		value="<%=MyIssueDetail.get("SubCategoryid")%>" />


	<input type="hidden" id="hversion"
		value="<%=MyIssueDetail.get("Version")%>" />


	<div style="width: 85%; padding-left: 8%">
		<div>

			<br /> Title: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input
				type="text" id="issuetitle" class="span8" name="issuetitle"
				value="<%=MyIssueDetail.get("Title")%>" size="150"
				style="padding-left: 3px; padding-top: 3px; padding-bottom: 3px" />

			<em>&nbsp;&nbsp; &nbsp; &nbsp; Bugid:</em> &nbsp;<input class="span2"
				type="text" style="width: 100px;" tabindex="4" id="bugid"
				value="<%=MyIssueDetail.get("Bugid")%>">

			<div class="side-by-side clearfix" style="padding-top: 20px;">

				<em>Module: &nbsp;</em> <select
					data-placeholder="Select a module..." class="chzn-select"
					style="width: 200px;" id="module"></select> <select id="category"
					class="chzn-select" style="width: 200px;" tabindex="2">

				</select> <select id="subcategory" class="chzn-select" style="width: 200px;"
					tabindex="2">

				</select> <em>&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; Version:&nbsp;</em> <select
					class="chzn-select" id="version" multiple style="width: 350px;"
					tabindex="4">

				</select>


			</div>
			<br /> <br />
			<textarea id="issuedetails" rows="30" cols="83"
				style="font-size: 14px; background-color: #f9f9f9;"></textarea>
			<br /> <input type="submit" id="editissuebtnsave" value="save"
				name="btnsave" class="btn" /> &nbsp;&nbsp;&nbsp; <input
				type="submit" id="btncancel" value="cancel" name="btncancel"
				class="btn" />
		</div>



	</div>



	<script src="chosen/chosen.jquery.js" type="text/javascript"></script>
	<script type="text/javascript">
			var config = {
				'.chzn-select' : {},
				'.chzn-select-deselect' : {
					allow_single_deselect : true
				},
				'.chzn-select-no-single' : {
					disable_search_threshold : 10
				},
				'.chzn-select-no-results' : {
					no_results_text : 'Oops, nothing found!'
				},
				'.chzn-select-width' : {
					width : "95%"
				}
			};
			for ( var selector in config) {
				$(selector).chosen(config[selector]);
			}
		</script>



	<script type="text/javascript">
			CKEDITOR
					.replace(
							'issuedetails',
							{
								filebrowserBrowseUrl : '/ckfinder/ckfinder.html',
								filebrowserImageBrowseUrl : '/ckfinder/ckfinder.html?type=Images',
								filebrowserFlashBrowseUrl : '/ckfinder/ckfinder.html?type=Flash',
								filebrowserUploadUrl : 'uploadfileservlet?module=KB',
								filebrowserImageUploadUrl : '/ckfinder/core/connector/java/connector.java?command=QuickUpload&type=Images',
								filebrowserFlashUploadUrl : '/ckfinder/core/connector/java/connector.java?command=QuickUpload&type=Flash'
							});

			$('.dropdown-toggle').dropdown();
		</script>
</body>
</html>